﻿
function checkword(obj, menu, searchList,returnId,btnPost) {
    
    var wordvalue = document.getElementById(obj.id).value.toLowerCase();    
        var alltxtpp = searchList.toLowerCase();
        var alltxt_xiang = searchList.split(";");
        var alltxt_xiang1 = searchList.split(";");       
        var inhtml = "<ul>"
        var isyou = 0;
        for (i = 0; i < alltxt_xiang1.length; i++) {
            var alltxt_xiang2 = alltxt_xiang1[i].split("|");                        
            inhtml = inhtml + "<li id='" + alltxt_xiang2[0] + "' style=\" list-style:none\" onclick=\"$('#" + obj.id + "').val(this.innerHTML);$('#" + returnId.id + "').val(this.id);$('#" + menu.id + "').hide();$('#" + btnPost.id + "').click();\" onmouseover=\"this.style.backgroundColor='#666666'\" onmouseout=\"this.style.backgroundColor=''\">" + alltxt_xiang2[1] + "</li>";                  
            isyou = 1;                         
        }
        inhtml = inhtml + "</ul>";
        if (isyou == 1) {
            $('#' + menu.id).html(inhtml);
           $('#'+menu.id).show();
        }
        else {
            $('#' + menu.id).html(inhtml);
            $('#' + menu.id).hide();
        }
        if (wordvalue == "") {
            $('#' + menu.id).html(inhtml);
            $('#' + menu.id).hide();
        }
    }
 